#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main ()
{
	int n = 0;
	int min = 100;
	int max = 0;
	int i = 0;
	int score = 0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&score);
		if(score>max)
			max = score;
		if(score<min)
			min = score;
	}
	printf("%d\n",max - min);
    return 0;
}